package nl.fonfolio.view.project {
	import flash.display.*;
	import flash.text.TextField;

	import nl.fonfolio.model.Model;
	import nl.fonfolio.controller.Controller;

	import nl.fonfolio.core.FonfolioEvent;	
	import flash.events.MouseEvent;
	
	/**
	 * @author Niels
	 */
	public class ProjectNav extends Sprite {
		private var model:Model;
		private var controller:Controller;
		
		public var fonfolio:Sprite;
		
		public var previous_btn:MovieClip;
		public var next_btn:MovieClip;
	
		public function ProjectNav(fonfolio:Sprite,model:Model,controller:Controller) {
			this.fonfolio = fonfolio;
			this.model = model;
			this.controller = controller;
			
			this.model.addEventListener(FonfolioEvent.CONTROL_TYPE, this.update);
			this.previous_btn.addEventListener(MouseEvent.CLICK, this.previousItem);
			this.next_btn.addEventListener(MouseEvent.CLICK, this.nextItem);
		}
		
		private function nextItem(event) : void {
			//var currentProject:Object = this.model.getProject();
			//for (var i : Number = 0;i <= currentProject.length - 1;i++) {
			//	this.controller.loadProjectHandler(id+1);
			//}
			trace("next item");
		}

		private function previousItem(event) : void {
			//this.controller.loadProjectHandler(id-1);
			trace("previous item");
		}

		private function update(event : FonfolioEvent) : void {
			switch (event.command){
				case "LOAD_PROJECT":

					
				break;
			}
		}
	}
}
